<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ page import="com.dimeina.service.*" %>
<%@ page import="com.dimeina.service.impl.*" %>
<%@ page import="com.dimeina.servlet.*" %>
<%@ page import="com.dimeina.vo.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商品信息管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<style type="text/css">
		.gridview {
			 border: 1px solid #1E82D1;
			 border-collapse: collapse;
			 width: 100%;
			 font-size:9pt;
		}
		
		.gridview th {
			height: 30px;
			line-height: 30px;
			background: #1E82D1;
			border: 1px solid #1E82D1;
			color:#fff;
			font-size:14px;
		}
		
		.gridview td {
			height:28px;
			border: 1px solid #1E82D1;
			text-align: center;
		}
		
		.gridview .btn{
			height: 30px;
			line-height:30px;
			width: 80px;
			display: inline-block;
			background: #1E82D1;
			color:#fff;
			text-align: center;
			text-decoration: none;
			border-radius: 15px;
		}
	</style>
  </head>
  
  <body>
  	<table class="gridview">
  		<tr>	
  			<th>编号</th>
  			<th>1级分类</th>
  			<th>父级分类</th>
  			<th>自身分类</th>
  			<th>商品名称</th>
  			<th>商品价格</th>
  			<th>创建时间</th>
  			<th>修改时间</th>
  			<th>操作</th>
  		</tr>
  		<%
  			ProService proService = new ProServiceImpl();
  			List<ProView> proViewList = proService.findAllProView();
  			for(ProView proView : proViewList) { %>
  			<tr>
  				<td><%= proView.getId() %></td>
  				<td><%= proView.getTopCategoryID() %></td>
  				<td><%= proView.getPCategoryID() %></td>
  				<td><%= proView.getCategoryID() %></td>
  				<td><%= proView.getName() %></td>
  				<td><%= proView.getPrice() %></td>
  				<td><%= proView.getCreateDate().toLocaleString() %></td>
  				<td><%= proView.getModifyDate().toLocaleString() %></td>
  				<td>
  					<a class="btn" href="servlet/back/ServletBack?opr=changePro&id=<%=proView.getId()%>">修 改</a>
  					<a class="btn" href="servlet/back/ServletBack?opr=delPro&id=<%=proView.getId() %>" onclick="return confirm('确定要删除此新闻吗？')">删 除</a>
  				</td>
  			</tr>
  		<% } %>
  	</table>
  </body>
</html>
